#include "fxcc/core/graph/opengl3/Texture3DJack.h"

fxcc::graph::opengl3::Texture3DJack::Texture3DJack(const Desc& desc)
    :fxcc::graph::common::Texture3DJack(desc), fxcc::graph::opengl3::Texture(GL_TEXTURE_3D)
{
    m_Available = Init();
}

bool fxcc::graph::opengl3::Texture3DJack::Init()
{
	switch (m_Desc.m_Type)
	{
	case Desc::Type::_DDS_:
		return InitDDS();
	default:
		return false;
	}
}

bool fxcc::graph::opengl3::Texture3DJack::InitDDS()
{
	if (!fs::exists(m_Desc.m_ddsPath))
	{
		return false;
	}
	m_Id = gliUtils2::create_texture(m_Desc.m_ddsPath.c_str());
	Bind();
	SetSampler(m_Desc.m_SamplerType);
	UnBind();
    return true;
}
